#include "system_service.h"

#include <memory>
#include <string>
#include <vector>
#include "utils_log.h"
#include "system_service_diagnosis.h"
#include "system_memory_monitor.h"
#include "utils_time.h"
#include "watchdog_manager.h"
#include "nlohmann/json.hpp"

namespace El {
namespace SystemService {

SystemService &SystemService::GetInstance()
{
    static SystemService instance;
    return instance;
}

bool SystemService::Start()
{
    // MemoryMonitor::GetInstance().Start();

    // 初始化看门狗
    WatchdogManager &watchdogManager = WatchdogManager::GetInstance();
    if (!watchdogManager.Start()) {
        EL_ERROR("Failed to start watchdog");
    } else {
        EL_INFO("Watchdog started successfully");
    }

    // 启动时间同步
    Utils::TimeManager::GetInstance().Start();

    // 启动调试接口
    SystemServerDiagnosis::GetInstance().Start();

    return true;
}

bool SystemService::Stop()
{
    return true;
}

} // namespace SystemService
} // namespace El
